﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace dome
{
    class Program
    {
        static void Main(string[] args)
        {
            Test t1 = new Test();//引用类型的定义及初始化
            Test t2 = t1;
            Console.WriteLine("t1:x={0},y={1}", t1.x, t1.y);
            Console.WriteLine("t2:x={0},y={1}", t2.x, t2.y);

            t2.x =5;
            Console.WriteLine("t1:x={0},y={1}", t1.x, t1.y);
            Console.WriteLine("t2:x={0},y={1}", t2.x, t2.y);

            String name = "小宇飞刀";//string 引用类型定义及初始化
            char sex = '男';
            double score = 87.5;
            string str1 = name;

            str1 = "xieyunnc";//这一操作并不会改变name变量的值

            Console.WriteLine("name ={0},sex={1},score={2}", name, sex, score);

            Console.WriteLine("Z:\\csharp_teach\babcd");
            Console.WriteLine("abcd");

            string s1 = null, s2 = "";
            string str2;
            str2 = s1 == s2 ? "相等":"不相等";
            Console.WriteLine("str2的值为：{0}", str2);
            //if(s1 == null)
            if (s2.Equals(string.Empty))
            {
                Console.WriteLine("条件为真");
            }

            str1 = "abc";
            str2 = "Abc";

            if (str1.ToLower() == str2.ToLower())//转化为小写
                Console.WriteLine("相等");
            else
                Console.WriteLine("不相等");

            if (string.Compare(str1,str2,true)==0)//判断相等,不分大小写
                Console.WriteLine("相等");
            else
                Console.WriteLine("不相等");

            if (str1.ToLower().CompareTo(str2.ToLower()) == 0)//判断相等
                Console.WriteLine("相等");
            else
                Console.WriteLine("不相等");




            Console.ReadKey();
        }
        
        
    }
    class Test
    {
       public int x = 0;
       public int y = 0;
    }
    
}
